home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / keySetOptionBoxCommon.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  18.3 KB  |  664 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. proc int
  18. hasCharacter (string $selectionConnection)
  19. //
  20. //    Procedure Name:
  21. //        hasCharacter
  22. //
  23. //    Description:
  24. //        Examine the member of a selection connection to see if a character
  25. //    is selected
  26. //
  27. //  Input Arguments:
  28. //        string hasCharacter        The name of the selection connection
  29. //
  30. //  Return Value:
  31. //      int true if the selection connection contains a character
  32. //
  33. {
  34.     if (!`selectionConnection -exists $selectionConnection`) {
  35.         return (false);
  36.     }
  37.     // For now we just need to examine whether or not there are characters
  38.     // in the highlightList, assuming the option box is listening to
  39.     // highlightList or animationList
  40.     //
  41.     if (($selectionConnection != "animationList") 
  42.     && ($selectionConnection != "highlightList")) 
  43.     {
  44.         return (false);
  45.     }
  46.     if (!`selectionConnection -exists highlightList`) {
  47.         return (false);
  48.     }
  49.     string $objects[] = `selectionConnection -query -object highlightList`;
  50.     for ($object in $objects) {
  51.         if (`nodeType $object` == "character") {
  52.             return (true);
  53.         }
  54.     }
  55.     return (false);
  56. }
  57.  
  58. proc keySetSetOptionVars( string $cmd, 
  59.                           int $forceFactory,
  60.                           int $allAnimCurves ) 
  61. //
  62. // Description:
  63. //    Generic proc shared by most animation command option boxes.
  64. //    
  65. // Arguments:
  66. //    $cmd             : Name of the prefix for the optionVars.
  67. //    $forceFactory    : Reset the optionVars to the factory-default settings.
  68. //    $allAnimCurves    : 0 / 1 : Can this cmd work on all animCurves?
  69. //    
  70. {
  71.     // all anim curves as targets
  72.     //
  73.     if( $allAnimCurves ) {
  74.         if( $forceFactory 
  75.         ||! `optionVar -exists ($cmd + "AllAnimCurves")` )
  76.         {
  77.             optionVar -intValue ($cmd + "AllAnimCurves") 0;
  78.         }
  79.     }
  80.  
  81.     // time range: 1: all, 2: playbackRange, 3: start/end
  82.     //
  83.     if( $forceFactory 
  84.     ||! `optionVar -exists ($cmd + "WhichRange")` ) 
  85.     {
  86.         optionVar -intValue ($cmd + "WhichRange") 1;
  87.     }
  88.  
  89.     // start/end values
  90.     //
  91.     if( $forceFactory 
  92.     ||! `optionVar -exists ($cmd + "Range")` )
  93.     {
  94.         optionVar -stringValue ($cmd + "Range") "0:10";
  95.     }
  96.  
  97.     // -hierarchy
  98.     //
  99.     if( $forceFactory 
  100.     ||! `optionVar -exists ($cmd + "Hierarchy")` ) 
  101.     {
  102.         optionVar -stringValue ($cmd + "Hierarchy") "none";
  103.     }
  104.  
  105.     // -controlPoints
  106.     //
  107.     if( $forceFactory 
  108.     ||! `optionVar -exists ($cmd + "ControlPoints")` )
  109.     {
  110.         optionVar -intValue ($cmd + "ControlPoints") 0;
  111.     }
  112.  
  113.     // -shape
  114.     //
  115.     if( $forceFactory 
  116.     ||! `optionVar -exists ($cmd + "Shapes")` )
  117.     {
  118.         optionVar -intValue ($cmd + "Shapes") 1;
  119.     }
  120.  
  121.     // use channel box attrs
  122.     //
  123.     if( $forceFactory 
  124.     ||! `optionVar -exists ($cmd + "UseChannelBox")` )
  125.     {
  126.         optionVar -intValue ($cmd + "UseChannelBox") 0;
  127.     }
  128.  
  129.     // use set driven channels
  130.     //
  131.     if( $forceFactory 
  132.     ||! `optionVar -exists ($cmd + "Driven")` )
  133.     {
  134.         optionVar -intValue ($cmd + "Driven") 0;
  135.     }
  136.  
  137. }
  138.  
  139. proc keySetSetup( string $cmd, int $doAllAnimCurves )
  140. //
  141. // Description:
  142. //    Setup widgets from optionVars.
  143. //    
  144. {
  145.     // all anim curves
  146.     //
  147.     if( $doAllAnimCurves ) {
  148.         int $allCurves = `optionVar -q ( $cmd + "AllAnimCurves" )`;
  149.         radioButtonGrp -e -select ( $allCurves + 1 ) allAnimCurves;
  150.     }
  151.  
  152.     // -hierarchy
  153.     //
  154.     string $hierarchy = `optionVar -query ( $cmd + "Hierarchy" )`;
  155.     if ($hierarchy == "below") {
  156.         radioButtonGrp
  157.             -edit
  158.             -select 2
  159.             hierarchy;
  160.     }
  161.     else {
  162.         radioButtonGrp
  163.             -edit
  164.             -select 1
  165.             hierarchy;
  166.     }
  167.  
  168.     // use channel box attrs
  169.     //
  170.     int $boxAttrs = `optionVar -q ( $cmd + "UseChannelBox" )`;
  171.     radioButtonGrp -e -select ( $boxAttrs + 1 ) channels;
  172.  
  173.     // use set driven attrs
  174.     //
  175.     int $drivenAttrs = `optionVar -q ( $cmd + "Driven" )`;
  176.     checkBoxGrp -e -value1 $drivenAttrs driven;
  177.  
  178.     // -controlPoints
  179.     //
  180.     int $controlPoints = `optionVar -q ( $cmd + "ControlPoints" )`;
  181.     checkBoxGrp -e -value1 $controlPoints controlPoints;
  182.  
  183.     // -shape
  184.     //
  185.     int $shapes = `optionVar -q ( $cmd + "Shapes" )`;
  186.     checkBoxGrp -e -value1 $shapes shapes;
  187.  
  188.     // time range: optionVar 1: all, 2: playback range 3: start/end
  189.     //
  190.     int $select = 1;
  191.     int $optionVal = `optionVar -query ( $cmd + "WhichRange" )`;
  192.     switch( $optionVal ) {
  193.         case 1:
  194.             $select = 1;
  195.             break;
  196.         case 2:
  197.             $select = 3;
  198.             break;
  199.         case 3:
  200.             $select = 2;
  201.             break;
  202.         default:
  203.             break;
  204.     }
  205.     radioButtonGrp -edit -select $select timeRange;
  206.  
  207.     // start/end times
  208.     //
  209.     string $time = `optionVar -query ( $cmd + "Range" )`;
  210.     string $range[];
  211.     tokenize ($time, ":", $range);
  212.     float $start = float ($range[0]);
  213.     float $end = float ($range[1]);
  214.     floatFieldGrp -edit -value1 $start frameStart;
  215.     floatFieldGrp -edit -value1 $end frameEnd;
  216. }
  217.  
  218. proc keySetCallback( string $cmd )
  219. //
  220. // Description:
  221. //    Set the option vars from the widget settings.
  222. //    
  223. {
  224.     // use all anim curves as targets
  225.     //
  226.     if( `radioButtonGrp -q -exists allAnimCurves` ) {
  227.         int $allAnimCurves = `radioButtonGrp -query -select allAnimCurves`;
  228.         optionVar -intValue ( $cmd + "AllAnimCurves" ) ($allAnimCurves - 1);
  229.     }
  230.  
  231.     // -hierarchy
  232.     //
  233.     string $hierarchy;
  234.     int $selected = `radioButtonGrp -query -select hierarchy`;
  235.     if ($selected == 2) {
  236.         $hierarchy = "below";
  237.     }
  238.     else {
  239.         $hierarchy = "none";
  240.     }
  241.     optionVar -stringValue ( $cmd + "Hierarchy" ) $hierarchy;
  242.  
  243.     // use channel box attrs
  244.     //
  245.     int $boxAttrs = `radioButtonGrp -query -select channels`;
  246.     optionVar -intValue ( $cmd + "UseChannelBox" ) ($boxAttrs - 1);
  247.  
  248.     // use driven attrs
  249.     //
  250.     int $drivenAttrs = `checkBoxGrp -query -value1 driven`;
  251.     optionVar -intValue ( $cmd + "Driven" ) $drivenAttrs;
  252.  
  253.     // -controlPoints
  254.     //
  255.     int $controlPoints = `checkBoxGrp -query -value1 controlPoints`;
  256.     optionVar -intValue ( $cmd + "ControlPoints" ) $controlPoints;
  257.  
  258.     // -shapes
  259.     //
  260.     int $shapes = `checkBoxGrp -query -value1 shapes`;
  261.     optionVar -intValue ( $cmd + "Shapes" ) $shapes;
  262.  
  263.     // which time range: optionVar 1: All, 2: Time Slider, 3: Start/End
  264.     //
  265.     int $select = 1; 
  266.     int $radioVal = `radioButtonGrp -q -select timeRange`;
  267.     switch( $radioVal ) {
  268.         case 1:
  269.             $select = 1;
  270.             break;
  271.         case 2:
  272.             $select = 3;
  273.             break;
  274.         case 3:
  275.             $select = 2;
  276.             break;
  277.         default:
  278.             break;
  279.     }
  280.     optionVar -intValue ( $cmd + "WhichRange" ) $select;
  281.  
  282.     // -time
  283.     //
  284.     string $time = string (`floatFieldGrp -query -value1 frameStart`) + ":" +
  285.         string (`floatFieldGrp -query -value1 frameEnd`);
  286.     optionVar -stringValue ( $cmd + "Range" ) $time;
  287. }
  288.  
  289.  
  290. proc keySetWidgetsEnable(string $selectionConnection)
  291. //
  292. // Description:
  293. //    
  294. //    
  295. {
  296.     int $hasCharacter = hasCharacter ($selectionConnection);
  297.  
  298.     int $enableIt = true;
  299.     if( `radioButtonGrp -q -exists allAnimCurves` ) {
  300.         $enableIt = ( `frameLayout -q -collapse allAnimCurvesFrame` ||
  301.                     ( `radioButtonGrp -q -select allAnimCurves` == 1 ) &&
  302.                     ( `radioButtonGrp -q -enable allAnimCurves` ) );
  303.         checkBoxGrp -e -enable $enableIt driven;
  304.         if ($enableIt && $hasCharacter) {
  305.             $enableIt = false;
  306.         }
  307.         // Hierarchy, Channels
  308.         //
  309.         radioButtonGrp -e -enable $enableIt hierarchy;
  310.         radioButtonGrp -e -enable $enableIt channels;
  311.     }
  312.     else {
  313.         radioButtonGrp -edit -enable (!$hasCharacter) hierarchy;
  314.         radioButtonGrp -edit -enable (!$hasCharacter) channels;
  315.     }
  316.  
  317.     // Control points and shapes
  318.     //
  319.     $enableIt = (( !`frameLayout -q -collapse attributesFrame` ) &&
  320.                  ( `radioButtonGrp -q -select channels` == 1 ) &&
  321.                  ( `radioButtonGrp -q -enable channels` ));
  322.     checkBoxGrp -edit -enable $enableIt controlPoints;
  323.     checkBoxGrp -edit -enable $enableIt shapes;
  324.  
  325.     // Start/End fields
  326.     //
  327.     int $useStartEnd = ( `radioButtonGrp -q -sl timeRange` == 2 ) &&
  328.                        ( `radioButtonGrp -q -enable timeRange` );
  329.  
  330.     frameLayout -e -enable $useStartEnd startEndFrame;
  331. }
  332.  
  333. proc keySetWidgets( string $cmd,
  334.                     string $selectionConnection,
  335.                     int $fromGraphEditor, 
  336.                     int $doAllAnimCurves,
  337.                     int $drivenChannels,
  338.                     int $timeRangeAll )
  339. //
  340. // Description:
  341. //    
  342. //    
  343. {
  344.     int $hasCharacter = hasCharacter ($selectionConnection);
  345.  
  346.     string $parent = `setParent -q`;
  347.  
  348.     if( $doAllAnimCurves ) {
  349.         frameLayout -bv no -lv no -collapsable yes 
  350.             -collapse $fromGraphEditor 
  351.             allAnimCurvesFrame;
  352.         
  353.             columnLayout -adjustableColumn true;
  354.                 radioButtonGrp -numberOfRadioButtons 2 -label "Objects"
  355.                     -label1 "Selected" 
  356.                     -cc1 ($cmd + "WidgetsEnable " + $selectionConnection)
  357.                     -label2 "All" 
  358.                     -cc2 ($cmd + "WidgetsEnable " + $selectionConnection)
  359.                     -enable (!$fromGraphEditor)
  360.                     allAnimCurves;
  361.                 
  362.                 separator -style "in" -w 1000;
  363.  
  364.                 setParent ..;
  365.             setParent ..;
  366.     }
  367.  
  368.     frameLayout -bv no -lv no -collapsable yes -collapse $fromGraphEditor
  369.         hierChanAttrFrame;
  370.  
  371.         columnLayout -adjustableColumn true;
  372.             radioButtonGrp
  373.                 -numberOfRadioButtons 2 -label "Hierarchy" 
  374.                 -label1 "Selected" -label2 "Below" 
  375.                 -enable (!$fromGraphEditor && !$hasCharacter )
  376.                 hierarchy;
  377.  
  378.             radioButtonGrp
  379.                 -numberOfRadioButtons 2 -label "Channels" 
  380.                 -label1 "All Keyable" 
  381.                 -cc1 ($cmd + "WidgetsEnable " + $selectionConnection)
  382.                 -label2 "From Channel Box" 
  383.                 -cc2 ($cmd + "WidgetsEnable " + $selectionConnection)
  384.                 -enable (!$fromGraphEditor && !$hasCharacter)
  385.                 channels;
  386.  
  387.             frameLayout -bv no -lv no -collapsable no attributesFrame;
  388.                 columnLayout -adjustableColumn true;
  389.                     frameLayout -bv no -lv no -collapsable yes
  390.                         -collapse (!$drivenChannels) drivenFrame;
  391.                         checkBoxGrp -value1 0  -ncb 1 -label "Driven Channels"
  392.                             -label1 ""     driven;
  393.                         setParent ..;
  394.                     checkBoxGrp -label "Control Points" -ncb 1 
  395.                         -value1 off -l1 "" -enable (!$hasCharacter) controlPoints;
  396.                     checkBoxGrp -label "Shapes" -ncb 1 
  397.                         -value1 on -l1 "" -enable (!$hasCharacter) shapes;
  398.                     setParent ..;
  399.                 setParent ..;
  400.  
  401.             separator -style "in" -w 1000;
  402.             setParent ..;
  403.  
  404.         setParent ..;    
  405.  
  406.     frameLayout -bv no -lv no -collapsable no timeRangeFrame;
  407.  
  408.         columnLayout -adjustableColumn true;
  409.  
  410.             int $nrb = 2;
  411.             if( $timeRangeAll == 1) {
  412.                 $nrb = 3;
  413.             }
  414.  
  415.             radioButtonGrp -numberOfRadioButtons $nrb -label "Time Range" 
  416.                 -enable true -onc ($cmd + "WidgetsEnable " + 
  417.                                    $selectionConnection) timeRange;
  418.  
  419.             if( $nrb == 2 ) {
  420.                 radioButtonGrp -e 
  421.                     -label1 "Time Slider" 
  422.                     -label2 "Start/End" 
  423.                     timeRange;
  424.             } else if( $nrb == 3 ) {
  425.                 radioButtonGrp -e 
  426.                     -label1 "All" 
  427.                     -label2 "Start/End" 
  428.                     -label3 "Time Slider" 
  429.                     timeRange;
  430.             }
  431.  
  432.  
  433.             frameLayout -bv no -lv no -collapsable no startEndFrame;
  434.                 columnLayout -adjustableColumn true;
  435.                     floatFieldGrp -label "Start Time" -value1 0.0 frameStart;
  436.                     floatFieldGrp -label "End Time" -value1 10.0 frameEnd;
  437.  
  438.                     separator -style "in" -w 1000;
  439.  
  440.  
  441.                     setParent ..;
  442.                 setParent ..;
  443.             setParent ..;
  444.         setParent ..;
  445.  
  446.     // We should be back to the level from which we were called.
  447.     // Just in case, set the parent to what it was when we started
  448.     //
  449.     setParent $parent;    
  450. }
  451.  
  452. proc keySetOptionBoxDoSelectionChanged(string $selectionConnection)
  453. //
  454. // Description:
  455. //    
  456. //    
  457. {
  458.     keySetWidgetsEnable ($selectionConnection);
  459.  
  460.     int $keys = `keyframe -q -sl -kc`;
  461.     int $isStartEnd = (`radioButtonGrp -q -select timeRange` == 2 );
  462.  
  463.     radioButtonGrp -e -enable ($keys == 0) timeRange;
  464.  
  465.     floatFieldGrp -e -enable (($keys == 0) && $isStartEnd) frameStart;
  466.     floatFieldGrp -e -enable (($keys == 0) && $isStartEnd) frameEnd;
  467. }
  468.  
  469. proc string keySetOptionBoxChannelBoxSyntax()
  470. //
  471. // Description:
  472. //    Append to syntaxString the proper "-at attrName" + objects
  473. //    syntax for any command working with selected channelBox attrs
  474. //    
  475. {
  476.     string $result;
  477.     string $attrs[] = `selectedChannelBoxAttributes`;
  478.  
  479.     for( $attr in $attrs ) {
  480.         $result = ( $result + " -at \"" + $attr + "\"");
  481.     }
  482.  
  483.     // Now add the specific objects from the channel box
  484.     //
  485.     string $objList[] = selectedChannelBoxObjects();
  486.     for( $object in $objList ) {
  487.         $result = $result + " " + $object;
  488.     }
  489.  
  490.     return $result;
  491. }
  492.  
  493. global proc string[] keySetOptionBoxCommon( string $argList[] )
  494. //
  495. // Description:
  496. //    Multi-purpose proc to handle much of the common 
  497. //    functionality in animation commands because of their
  498. //    common cmd-flags and optionBox-widgets.  (The resulting
  499. //    values in the string array returned by this proc depend
  500. //    on the "action" specified in $argList[2].)
  501. //    
  502. //    The first element of $argList is the name of the command.
  503. //    Note that this name is not the MEL-name of the command;
  504. //    it's just a prefix used to uniquely identify option settings. 
  505. //    
  506. //    The second element of $argList is the name of the selection
  507. //    connection that the command is going to operate upon.
  508. //
  509. //    The remainder of the elements of $argList are determined by
  510. //    the second element of the array, the element identifying the "action"
  511. //    to perform.  What follows is a description of the possible "actions"
  512. //    and their required arguments.
  513. //     
  514. //     Arguments marked with a "*" indicate optional arguments.  They 
  515. //     will not cause an error in script execution when omitted, and 
  516. //    will be set to their default values.
  517. //    
  518. //    // This action sets up values for the optionVars involved in this
  519. //    // this option box's default settings.  Can optionally force them 
  520. //    // to be the factory default settings.
  521. //    //
  522. //    $argList[2] == "setOptionVars"
  523. //        $argList[3]     : 1/0         reset options to factory settings 
  524. //        $argList[4]     : 1/0         operate on all animation curves
  525. //        Returns an empty string array.
  526. //        
  527. //    // Sets the initial value of widgets in the option box to their
  528. //    // saved optionVar (preference) settings.
  529. //    //
  530. //    $argList[2] == "setup"
  531. //      * $argList[3]     : 1/0         operate on all animation curves [Def: 0]
  532. //        Returns an empty string array.
  533. //        
  534. //    // Sets the optionVar (preference) settings to the current
  535. //    // state of the widgets displayed in the optionBox.  Note: this
  536. //    // action requires no additional arguments.
  537. //    //
  538. //    $argList[2] == "callback"
  539. //        Returns an empty string array.
  540. //      
  541. //    // Various widget states require other widgets to enable or disable
  542. //    // accordingly.  This action ensures that any widgets created and/or
  543. //    // managed by keySetOptionBoxCommon are correctly enabled or
  544. //    // disabled.  Note: this action requires no additional arguments.
  545. //    //
  546. //    $argList[2] == "enable"
  547. //        Returns an empty string array.
  548. //
  549. //    // Various widget states require other widgets to enable or disable
  550. //    // accordingly.  This action ensures that any widgets created and/or
  551. //    // managed by keySetOptionBoxCommon are correctly enabled or
  552. //    // disabled.  Note: this action requires no additional arguments.
  553. //    //
  554. //    $argList[2] == "widgets"
  555. //        $argList[3]     : 1/0         invoked from the GraphEditor?
  556. //      * $argList[4]     : 1/0         include all animation curves? [Def: 0]
  557. //      * $argList[5]     : 1/0         include the "do driven" widget? [Def: 1]
  558. //        Returns an empty string array.
  559. //      
  560. //    // Various widget states require updates on Selection List changes.
  561. //    // Most notably, the Time Range widgets in GraphEditor versions of 
  562. //    // option boxes: they disable when there's an active key.  No additional
  563. //    // required.
  564. //    //
  565. //    $argList[2] == "selectionChanged"
  566. //        Returns an empty string array.
  567. //      
  568. //    // Many animation option boxes generate a command based on the
  569. //    // attributes that are currently selected in the channel box.
  570. //    // The resulting command syntax is returned as the first (and only)
  571. //    // element of the string[] result.
  572. //    //
  573. //    $argList[2] == "channelBoxSyntax"
  574. //        Returns a one-element array containing the desired syntax.
  575. //
  576. {
  577.     string $result[];
  578.  
  579.     if( size( $argList ) < 3 ) {
  580.         error( "keySetOptionBoxCommon: requires $cmd, $selectionConnection, $action" );
  581.     }
  582.  
  583.     string $cmd                 = $argList[0];
  584.     string $selectionConnection = $argList[1];
  585.     string $action                = $argList[2];
  586.  
  587.     if( $action == "setOptionVars" ) {
  588.         // They at least have to specify $forceFactory.
  589.         // We'll be more leanient on a missing $allAnim,
  590.         // since it's less common.
  591.         //
  592.         if( size( $argList ) < 4 ) {
  593.             error( "keySetOptionBoxCommon: " + $cmd + 
  594.                    "'setOptionVars' argument error" );
  595.         }
  596.  
  597.         int $forceFactory         = $argList[3];
  598.         int $allAnim            = size( $argList ) > 4 ? $argList[4] : 0;
  599.  
  600.         keySetSetOptionVars( $cmd, $forceFactory, $allAnim );
  601.     }
  602.     else if( $action == "setup" ) {
  603.         int $allAnim            = size( $argList ) > 3 ? $argList[3] : 0;
  604.  
  605.         keySetSetup( $cmd, $allAnim );
  606.     }
  607.     else if( $action == "callback" ) {
  608.         keySetCallback( $cmd );
  609.     }
  610.     else if( $action == "enable" ) {
  611.         keySetWidgetsEnable($selectionConnection);
  612.     }
  613.     else if( $action == "widgets" ) {
  614.         // They at least have to specify $fromGraphEditor.
  615.         //
  616.         if( size( $argList ) < 4 ) {
  617.             error( "keySetOptionBoxCommon: " + $cmd + 
  618.                    "'widgets' argument error" );
  619.         } 
  620.  
  621.         int $fromGraphEditor     = $argList[3];
  622.         int    $doAllAnimCurves    = 0;
  623.         int    $driven             = 1;
  624.         int    $timeRangeAll       = 1;
  625.  
  626.         if( size( $argList ) > 4 ) {
  627.             $doAllAnimCurves = $argList[4];
  628.         }
  629.  
  630.         if( size( $argList ) > 5 ) {
  631.             $driven = $argList[5];
  632.         }
  633.  
  634.         if( size( $argList ) > 6 ) {
  635.             $timeRangeAll = $argList[6];
  636.         }
  637.  
  638.         keySetWidgets( $cmd, $selectionConnection, $fromGraphEditor, $doAllAnimCurves, $driven,
  639.                        $timeRangeAll );
  640.     }
  641.     else if( $action == "selectionChanged" ) {
  642.         if( size( $argList ) != 3 ) {
  643.             error( "keySetOptionBoxCommon: " + $cmd + 
  644.                    "'selectionChanged' argument error" );
  645.         }
  646.  
  647.         keySetOptionBoxDoSelectionChanged $selectionConnection;
  648.     }
  649.     else if( $action == "channelBoxSyntax" ) {
  650.         if( size( $argList ) != 3 ) {
  651.             error( "keySetOptionBoxCommon: " + $cmd + 
  652.                    "channelBoxSyntax argument error" );
  653.         }
  654.  
  655.         $result[0] = keySetOptionBoxChannelBoxSyntax();
  656.     }
  657.     else {
  658.         error( "keySetOptionBoxCommon: action \"" + $action + 
  659.                "\" is invalid" );
  660.     }
  661.  
  662.     return $result;
  663. }
  664.